package com.heyqing.topic.RemoveElements_0203;

import java.util.Objects;

/**
 * ClassName:RemoveElements
 * Package:com.heyqing.topic.RemoveElements_0203
 * Description:
 *
 * @Date:2024/9/21
 * @Author:Heyqing
 */
public class RemoveElements {
    public ListNode removeElements(ListNode head, int val) {
        if (Objects.isNull(head)) return null;
        head.next= removeElements(head.next,val);
        return head.val == val ? head.next : head;
    }
}
